class Solution:
    def maxArea(self, height) -> int:
        max = 0
        i = 0
        j = len(height)
        moveLeft = False
        while i < j and j >= 0:
            h = 0
            if height[i] > height[j - 1]:
                h = height[j - 1]
                moveLeft = True
            else:
                h = height[i]
                moveLeft = False
            area = (j - i - 1) * h
            if area > max:
                max = area

            if moveLeft:
                j -= 1
            else:
                i += 1
        return max


solution = Solution()
print(solution.maxArea([1, 1]))

# SUCCESS
# Runtime: 52 ms, faster than 97.80% of Python3 online submissions for Container With Most Water.
# Memory Usage: 14.5 MB, less than 60.20% of Python3 online submissions for Container With Most Water.

# 这道题的主要就是利用从两端向中间搜索的思想，哪边值较小，就让哪边移动，这个思想在数据结构中有个树的平衡就是这样。
# 最多只能算easy吧。
